Handle ActiveRecord::RecordNotFound error when trying to lock a job