Since your PHP script is waiting for a response from the MySQL server, it may be difficult to determine what state the query it has committed is in as it executes. If you're having problems with read locks in queries, you're probably better off going about problem solving and investigating why your queries are getting locked to the point where it is causing your scripts to hang, rather than just botching together some sketchy handlers for it, because locked queries can indicate a serious underlying problem.
Consult the MySQL documentation and the mysql performance blog for pointers on how to tweak startup variables for your MySQL server to help improve performance. Also make sure you're carefully using PHP sessions in a managed way - if you have lots of asynchronous requests at the same time to your server from a single user, PHP can sometimes hang because the session file is locked from multiple threads, making database queries hang with it. This is a serious problem that we encountered.
Locked queries can be pretty tricky to troubleshoot, but the best thing for you to do is to investigate the root cause of why they're getting locked and resolve it. Executing SHOW FULL PROCESSLIST; will give you a list of all your open connections to your database and can give you information to help you identify slow running queries that are locking up subsequent queries.
Hope that helps, good luck.