500 error on updating Craft I'm trying to update from 2.3.2640 to 2.3.2644, but I get a 500 error

Internal Server Error
The server encountered an internal error or
misconfiguration and was unable to complete
your request.
Please contact the server administrator,
you@example.com and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.
More information about this error may be available
in the server error log.


When I look a the logs I can see that the backup was successful

2015/05/20 13:23:15 [info] [application] [Forced] Finished backing up database.
in /xxx/craft/app/services/UpdatesService.php (399)
in /xxx/craft/app/controllers/UpdateController.php (317)
in /xxx/craft/app/etc/web/WebApp.php (869)


And the sql file is in the backup folder.

Any idea where I might look to fix this error?

EDIT: I see that it's timing out at 30 seconds. I've set my php file to have max_execution_time = 60, but it's still timing out at 30 seconds...
Step 01. 
Open your php.ini file.
File path for php 5.6: /etc/php/5.6/apache2/php.ini
File path for php 7.1: /etc/php/7.1/apache2/php.ini

Step 02:
Then increase max_exection_time from 30 to 300 or other as you like. 

Step 03:
Restart your server sudo service apache2 restart

Step 04:
Go to your web's root directory then run this command composer update

Now browse your site.