URL checker is very slow
Your script is slow because you are doing a sequence of HTTP REQUESTS. Most of the time your server / script is just waiting for the RESPONSE of the requested URL. 

small things you can do


as mentioned yourself in the comments you can change your max execution time to prevent reaching it. (which does not make your script any faster ; -)
move away from get headers and use curl or similar to have the ability to change the connection timeout. You could set it to 1 sec and flag every url which fails to manual review (assuming all healthy urls will respond in time , and some slow false positives). Small benefit: your script should be finished in max url*sec time 


big things

so the problem is: in practice is your script waiting for responses, in theory it does not have to , as the checking of an url does not depend on each other. Classic case for parallelization. Downside: php is not the language you want to do parallelization in. 

upside: you are not the first with this problem


https://stackoverflow.com/questions/9308779/php-parallel-curl-requests
http://reactphp.org/


or use golang or something with build in parallelization