connection->getQueryBuilder(); $qb->select('*') ->from('oauth2_access_tokens'); $cursor = $qb->executeQuery(); while ($row = $cursor->fetch()) { $token = AccessToken::fromRow($row); try { $appToken = $this->tokenProvider->getTokenById($token->getTokenId()); $appToken->setExpires($this->time->getTime() + 3600); $this->tokenProvider->updateToken($appToken); } catch (InvalidTokenException $e) { //Skip this token } } $cursor->closeCursor(); } }