The LoB principle dictates that the behavior of a unit of code should be as obvious as possible by looking only at that unit of code. But I think something is missing from this discussion.
PHP
Laravel Deadlocks: Queue Jobs That Already Ran End Up in failed_jobs
Below MySQL 8.0.1, or on a server Laravel misreads, workers reserve jobs with a plain FOR UPDATE and can deadlock on the DELETE. One tinker line shows which lock yours use. Read more