Yeah, what just happened was that the query finally finished in MySQL so it would've run instantly the next time. There's not a lot we can do about this on the web side unfortunately - for example, with a 500 error, it's your web server just killing the process. The query is still running in the background, but since your web server killed the process, you see an error. It's a single long query so there's nothing that can be done to split it up.
On a side note, with a 1.6 million post forum, you really will want SSH "just in case". It allows you to do various things that can't be done easily via the web (DB backups being a good example).