I went a little bit farther. I discovered that the plugin causing the timeout is the mod_scorm.
I can see in the mdl_upgrade_log that the server starts the upgrade, but it never finishes it.
I thought of removing it from the file system and adding it back once I'm at the end of my upgrade path. So far I managed to upgrade successfully from 2.3 to 2.4. Now I'm stuck on 2.4 -> 2.6
Any advice?
Thanks