def METHOD_NAME(self):
    """Acquire the next job to be run.
    :returns: queue.job record (locked for update)
    """
    # TODO: This method should respect channel priority and capacity,
    #       rather than just fetching them by creation date.
    self.env.flush_all()
    self.env.cr.execute(
        """
        SELECT id
        FROM queue_job
        WHERE state = 'pending'
        AND (eta IS NULL OR eta <= (now() AT TIME ZONE 'UTC'))
        ORDER BY date_created DESC
        LIMIT 1 FOR NO KEY UPDATE SKIP LOCKED
        """
    )
    row = self.env.cr.fetchone()
    return self.browse(row and row[0])