Determine Next Item in DrupalQueue for Drupal 7
SystemQueue::claimItem has the code you're looking for. https://api.drupal.org/api/drupal/modules%21system%21system.queue.inc/function/SystemQueue%3A%3AclaimItem/7.x

You can run the same query that will be used to get the next item in the queue. Just replace $this-&gt;name in the code below with the queue name.

    $item = db_query_range('SELECT data, item_id FROM {queue} q WHERE expire = 0 AND name = :name ORDER BY created, item_id ASC', 0, 1, array(
      ':name' =&gt; $this-&gt;name,
    ))
      -&gt;fetchObject();


$item should have everything you're looking for.