nextPendingExecutionFor

The $next selection: the oldest IN_PROGRESS execution for the thing first, else the oldest QUEUED one, considering only jobs which are themselves still IN_PROGRESS. This is a read: callers decide whether the pick transitions.