Change the value of a taxonomy field on cron run
You store the value returned from \Drupal::entityTypeManager()
    -&gt;getStorage('node') in $storage, but you don't use it. On the next line you use \Drupal::entityQuery(). (I don't recommend it, as it will be deprecated in Drupal 9; you should use the entity type manager.)

The code I would use is the following one.

  use Drupal\Core\Datetime\DrupalDateTime;

  // Build Drupal DateTime &amp; set correct format for your query
  $curent_time = new DrupalDateTime('now');
  $curent_time = $curent_time-&gt;format('Y-m-d\TH:i:s');

  // Get Entity Manager to build your query
  $storage = \Drupal::entityTypeManager()
      -&gt;getStorage('node');

  // Get all Nodes satisfing your conditions
  $nids = $storage-&gt;getQuery()
      -&gt;condition('type', 'article')
      -&gt;condition('field_verification_status', 272)
      -&gt;condition('field_article_expiry_date', $curent_time, '&lt;=')
      -&gt;execute();

  // Load all Node entities according to their IDs
  $nodes = \Drupal\node\Entity\Node::loadMultiple($nids);

  // Do whatever you want with Nodes
  foreach ($nodes as $node) {
    // Do something
    $node-&gt;save();  
  }


See also


DrupalDateTime
DateTime in queries