UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UvfiBeuDJHfudqvMMXoe3ViD+VctALSg+F0hEeX9nSY='
WHERE
key_id = 'bd3d0855f03752777f97fd43ee4e75dfed281deb9241af8cb850a2effac0d7b8'
AND (
token = 'UvfiBeuDJHfudqvMMXoe3ViD+VctALSg+F0hEeX9nSY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)