IS_FREE_LOCK()
IS_FREE_LOCK(string)Use this function to determine whether the name of the lock given in parentheses is free and available as a lock name. The function returns 1 if the lock name is free, and 0 if it’s not (because it is in use by another client). The function returns NULL if there is an error. Locks are created by GET_LOCK(). This function is available as of version 4.0.2 of MySQL. Here is an example:
SELECT IS_FREE_LOCK('my_lock');
+-------------------------+
| IS_FREE_LOCK('my_lock') |
+-------------------------+
| 0 |
+-------------------------+The results here indicate that the lock is not free.