Optimize Table query causing Fatal error during execution with InnoDB table
Ok I feel really stupid now...
Problem had nothing to do with MySQL Server settings etc.
Problem was that in my service (that is communicating with MySQL) I'm using MySqlCommand Object (Service is coded using VB NET). This MySqlCommand object has a parameter CommandTimeout and its default value is 30. So that was the reason why executions longer than 30s caused timeout that throws fatal error..
So now I'm setting this parameter large enough in my VB NET code before executing command and everything is working as planned!