MySQL 5.7.5 og MariaDB 10.0.2 understøtter begge din use case nu.
For MySQL se:https://dev.mysql.com /doc/refman/5.7/da/locking-functions.html
For MariaDB se:https:// mariadb.com/kb/en/mariadb/documentation/functions-and-operators/miscellaneous-functions/get_lock/