protected function getUpdateUserSecurityIdentitySql(UserSecurityIdentity $usid, $oldUsername)
    {
        if ($usid->getUsername() == $oldUsername) {
            throw new \InvalidArgumentException('There are no changes.');
        }

        $oldIdentifier = $usid->getClass().'-'.$oldUsername;
        $newIdentifier = $usid->getClass().'-'.$usid->getUsername();

        return sprintf(
            'UPDATE %s SET identifier = %s WHERE identifier = %s AND username = %s',
            $this->options['sid_table_name'],
            $this->connection->quote($newIdentifier),
            $this->connection->quote($oldIdentifier),
            $this->connection->getDatabasePlatform()->convertBooleans(true)
        );
    }