Change your relevant version's php.ini:
max_execution_time = 180 (tripling the default, at least)
Edit:
/opt/alt/php-fpmXX/usr/etc/php-fpm.d/www.conf.default to include
fastcgi_read_timeout = 3000
And edit your nginx config to include (in the
http section):
fastcgi_read_timeout 3000;
Then reload php-fpm and nginx:
service phpXX-fpm reload
service nginx reload