LOCKED are syntaxes added in MySQL 8.0 and MariaDB 10.3.
The idea came from AliSQL (MySQL fork by Alibaba). It was
revisited in MySQL, and I am not aware if MariaDB used the
original implementation. EDIT: As Morgan Tocker
points out in a comment, originally Ali Baba filed a feature request to MySQL.
While MySQL and MariaDB syntaxes are similar, there are important differences and the compatibility is only apparent. This article discusses these differences.
This syntax is only available in MariaDB. It means that, if a row or table that we want to read is write-locked, we can wait up to the specified number of seconds. If the lock is not released after the timeout occurs, the query will fail.