How to add slots for Slot table such that there are no clash
BEGIN;
SELECT ... FOR UPDATE;
check for no overlaps (or whatever)
INSERT (or update) new entry
COMMIT;


In InnoDB, locking the whole table is equivalent to locking every row.  Do I need to explain that that is a lot more costly than locking a single row?

Your SELECT ... FOR UPDATE should pessimistically lock whatever rows you don't want mucked with until the end of the transaction.  Often it is a single row (lock one row ... update that row).  Or, it could involve locking several rows before deciding which row(s), if any, will actually be updated.

You should minimize the number of rows locked -- for speed of the SELECT, for speed of the ROLLBACK/COMMIT, and for minimizing interference with other queries.

Unless you have hundreds of UPDATEs happening per second, locking too many rows is not a big deal -- after all, your transaction should be designed to finished in only a few milliseconds, not the default `innodb_lock_wait_timeout=50 (seconds).