Hi Matthew,
I had the same issue while upgrading (PHP timeout in my case, during step 4 as well). I found somewhere on the forum the suggestion to delete the .step file located here:
nextcloud-data/updater-randomstring/.step (where randomstring is, well, a random string added by the updater).
I was then able to restart and complete the update process.
Hope this helps,
Cyril