As I was just looking into this - here's a quick and dirty workaround. In admin/moderation.php find this piece of code (search for the "run SQL" comment):
Text Formatted Code
// run SQL but this time ignore any errors
if (!empty ($sql)) {
$sql .= ' LIMIT 50'; // <-- add this line
$result = DB_query($sql, 1);
}
That will ensure that only 50 submissions will be requested at once, preventing the timeout. You can then use the first column in the submission queues to select and delete all the entries. It will then display the next 50 entries, and so on.
Just an alternative for those who don't want to mess around in the database ...