title: MySQL select / update racing condition
body: <p>I would like to query a database table for some of it's oldest entries and update them with a second query afterwards.</p>
  
  <p>But how can I prevent that another process (that does the same) will return the same rows by the SELECT query and the UPDATE part will modify the entries twice?</p>
  
  <p>As far as I see a simple transaction cannot prevent this from happening.</p>