async def METHOD_NAME(self, api_key: str) -> Optional[UserInfo]:
    async with self._db.cursor() as cursor:
        await cursor.execute('''
            SELECT t_token.user_id AS id, t_user.username, t_user.email,
               CONCAT_WS(" ", t_user.firstname, t_user.lastname) AS fullname
            FROM kontext_api_token AS t_token
            JOIN kontext_user AS t_user ON t_user.id = t_token.user_id
            WHERE value = %s AND
                  active = 1 AND
                  valid_until >= %s
        ''', (api_key, datetime.now()))
        data = await cursor.fetchone()
    if data is None:
        return None
    return UserInfo(
        id=data['id'],
        user=data['username'],
        fullname=data['fullname'],
        email=data['email'],
        api_key=api_key)