How to prevent jobs from dying before they start?

We have a situation where we have a build server with 2 slots, and a build can take several hours. We rely on a queue system. But we’ve noticed jobs in the queue will go into a “stuck state” when they cant get a runner, and then get cancelled after about an hour of being stuck

How can we increase the timeout time for jobs that cant get a runner? We have the job timeout set to 16 hours, but this doesnt appear to affect the queue and stuck time.