SELECT ... FOR UPDATE
Learn SELECT ... FOR UPDATE (Locks & Concurrency, MySQL) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Introduction SELECT ... FOR UPDATE reads rows and places exclusive locks on them for the rest of the transaction. Others can neither update them nor lock them until you commit, so you can safely read, decide, then write.