UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yhCP3RSnMEr3/azeMsgg0XgeQwqRnqwgSs186dPJjmc='
WHERE
key_id = 'a3e8b54375206259e4f5e75ea4d81bc885a65690ad683237752ad8de47656ab6'
AND (
token = 'yhCP3RSnMEr3/azeMsgg0XgeQwqRnqwgSs186dPJjmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)