def METHOD_NAME(self, username, key=''):
    """Add or update user auth token.
    """
    try:
        token_obj = self.get(user=username)
    except Token.DoesNotExist:
        token_obj = self.model(user=username)
    if key is not None:
        token_obj.key = key
    else:
        token_obj.key = self.generate_key()
    token_obj.save(using=self._db)
    return token_obj