As it happens in these cases, I was actually editing a wrong configuration file that didn't get loaded by Nginx.
Adding the following to the right file did the trick:
fastcgi_read_timeout 600;fastcgi_send_timeout 600;fastcgi_connect_timeout 600;