Usually that happens when you use JOIN for combining multiple table in database. If your mysql query takes more time, then server could give you negative response like
#2013 - Lost connection to MySQL server during query
Or
MySQL server has gone away
SELECT RELEASE_LOCK('b131086dbc463d8c717e59bd41af9cdd914ce035') AS...