Use another field value as condition in Entity Query
The entity query is a powerful and convenient tool to query for content and config entities that have certain properties/field values/field references.

Yet, it has its limitations. Comparing two fields is not possible using the generic entity query and its condition method.

For such a task, you may need to use the more low level dynamic (select) queries and its where method. An example for your use case:

$connection = \Drupal::database();
// Query node base field table.
$query = $connection-&gt;select('node_field_data', 'n');
// Join with the `field_days` field table.
$query-&gt;leftjoin('node__field_days', 'd', 'd.entity_id = n.nid');
// Query for the node ID.
$query-&gt;fields('n', ['nid']);
// Your condition (a day has 86400 seconds; we multiply them with
// the value of the field_days field, add them to the changed
// timestamp of the node and compare it against the current time).
$query-&gt;where('n.changed + (d.field_days_value * 86400) &lt;= :now', [
  ':now' =&gt; \Drupal::time()-&gt;getCurrentTime(),
]);
// Optional sorting.
$query-&gt;orderBy('n.changed', 'DESC');
// Fetch results.
$result = $query-&gt;execute()-&gt;fetchAllKeyed(0, 0);


Above example assumes:


that you used a numeric field type for field_days, so its database stored value can be multiplied with seconds without any casting,
that the field_days field allows one value only, so we can safely ignore field deltas when joining,
that field_days is present on all nodes/bundles and has a valid value,
that you use one language only in your site/the field_days value is not translatable, so we can also ignore langcodes.


You may have to alter the query accordingly, if any of these assumptions is not true.