title: Resource access lock PHP
body: <p>I am developing a simple support application where clients ask questions and admins answer them.  I need to implement a resource lock for a question to avoid multiple admins working on same question and avoid data collision.  What are best practices for this kind of task? </p>
  
  <p>PS I am using PHP and MySQL base to store questions.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I know that i just simply could put a state field to that resource and when opened ill lock it but how do i close it if lets say admin just closes the browser window.</p>