Assuming you have a unique index on the name field, this can be achieved without any additional query.
PHP Code:
$stmt = $adopts->query('...');
if ( ! $stmt)
{
// failed, the name is already in use
}
else
{
// successfully renamed
}
I think this would be a much better solution, because not only that you keep the MySQL from choking, but you also keep your code succinct.