max_execution_time defines the real time your script is allowed to run, so this does not includes any time spent outside of the script execution, even if it was triggered by it: database queries, filesystem polling, network, etc.
Solution is to use inotifywait's -t <seconds>, --timeout <seconds>
option.