create a lock file while the process is running to prevent race condition

A lock file is created while the request is being processed. If the lock is not released after 60s, break it and run the process as expected.

Not sure if we should break the lock after the timeout, but if for some reason, an error occurs and the lock is not released, it will stay there until someone manually deletes it.