Problems with tasks and max execution time
Tasks are just another PHP request and they are subject to the same web server and php.ini limitations as a "normal" request.

Sounds like you just need to up your max_execution_time.