In my production error logs I occasionally see:
SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction
>
Extrapolating from Rolando's answer above, it is these that are blocking your query:
---TRANSACTION 0 620783788, not started, process no 29956, OS thread id 1196472640
MySQL thread id 5341773, query id 189708353 10.64.89.143 viget
If you need to execute your query and can not wait for the others to run, kill them off using the MySQL thread id:
kill 5341773
(from within mysql, not the shell, obviously)
You have to find the thread IDs from the:
show engine innodb status\G
command, and figure out which one is the one that is blocking the database.