connection->getQueryBuilder(); // The maximum valid value is NOW + 7 days, but since updating is fixed // and you only run into the bug at the year 2038, we can also count up 8 days. $time = time() + 3600 * 24 * 8; $query->update('notifications_settings') ->set('next_send_time', $query->createNamedParameter(1, IQueryBuilder::PARAM_INT)) ->where($query->expr()->gt('next_send_time', $query->createNamedParameter($time, IQueryBuilder::PARAM_INT))); $count = $query->executeStatement(); if ($count > 0) { $output->info('Fixed next send of ' . $count . ' disabled users'); } } }