private void expireOldRefreshToken(final AccessTokenRequestContext tokenRequestContext) throws Exception {
        val oldRefreshToken = tokenRequestContext.getToken();
        if (!oldRefreshToken.isStateless()) {
            LOGGER.debug("Expiring old refresh token [{}]", oldRefreshToken);
            oldRefreshToken.markTicketExpired();
            ticketRegistry.deleteTicket(oldRefreshToken);
        }
    }
This is {@link OAuth20DefaultTokenGenerator}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/response/accesstoken/OAuth20DefaultTokenGenerator.java