andWhere(['<', 'expire_time', time()]) ->each(1000); foreach($accessTokens as $token) { /** @var OauthAccessToken $token */ $token->delete(); } return self::EXIT_CODE_NORMAL; } }