If you have a large database, it can take a bit to update many records. By default, php will only let a script run for 30 seconds before it times out. If you need your script to run longer before it is timed out, you can increase the max_execution_time.
try adding the following at line 1 of your update page:
this will set php to allow the script to run for 120 seconds. If you need it to run longer, you can increase the number of seconds.