UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5iRDYx/zyVakSvGyaWbjZTyiCz9TJm01xa2bzN+JKOI='
WHERE
key_id = 'af04f3f654c827f482ebf6967ec575b99c9538c17bba884608ae491844fccf39'
AND (
token = '5iRDYx/zyVakSvGyaWbjZTyiCz9TJm01xa2bzN+JKOI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)