Seeing as you've not posted the sql error message...
Alternative route is to put the user id AND a key in the link. That way the key from uniqid() doesn't have to be unique as long as it is correct. Then you don't need to worry about it being a unique column.
My helpful sig has gone because a mod below the administrator gave me an infraction - despite the administrator personally agreeing to it.
If you need any php tips or tricks you can PM me.