I would filter the jobs here. It's non-obvious that a method called unlock_job won't unlock a job if it's too new. 

Also, the period.should be configurable like so:

    filter_jobs(QueueClassicJob).where("locked_at IS NOT NULL AND locked_at < ?", params.fetch(:age, 5.minutes).ago) do
        unlock_job(job)
    end