def METHOD_NAME(self, application, scopes, update):
    """
    Create application access with specified scopes.
    If application access already exists, then:
      * Update with specified scopes if update=True,
      * Otherwise do nothing.
    """
    access = ApplicationAccess.objects.filter(application_id=application.id).first()
    if access and update:
        access.scopes = scopes
        access.save()
        logger.info('Updated application access for {} with scopes: {}'.format(
            application.name,
            scopes,
        ))
    elif access:
        logger.info('Application access for application {} already exists.'.format(
            application.name,
        ))
    else:
        application_access = ApplicationAccess.objects.create(
            application_id=application.id,
            scopes=scopes,
        )
        logger.info('Created application access for {} with scopes: {}'.format(
            application.name,
            application_access.scopes,
        ))