 <p>This is what transactions are for. Your booking code should BEGIN a transaction, confirm that the time is available using SELECT, and if it is available, INSERT or UPDATE the database to make the reservation, finally COMMITing the transaction. </p> <p>If the time is not available, either don't INSERT or UPDATE the database to make the reservation, or ROLLBACK the transaction.</p>