I have the following simplified table in Postgres:
You could check with a regular expression:
SELECT * FROM user WHERE ('jsdfhiureeirh' ~ E'^[[:xdigit:]]{8}-([[:xdigit:]]{4}-){3}[[:xdigit:]]{12}$' AND id = 'jsdfhiureeirh') OR uid = 'jsdfhiureeirh';