private void updateOAuthCode(final AccessTokenRequestContext tokenRequestContext) throws Exception {
        val token = tokenRequestContext.getToken();
        if (tokenRequestContext.isCodeToken() && !token.isStateless()) {
            token.update();
            LOGGER.trace("Updated OAuth code [{}]", token.getId());
            if (token.isExpired()) {
                ticketRegistry.deleteTicket(token);
            } else {
                ticketRegistry.updateTicket(token);
            }
            updateTicketGrantingTicket(tokenRequestContext.getTicketGrantingTicket());
        }
    }
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