UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uEYSHCcnoStEfTBPQHOgI3zyUhadDcDofUfVCwyoF1g='
WHERE
key_id = '2ac31c1fc060e32c38250d1ba2dcf5e3160f4ec0aac081ddda641bd635f9cc76'
AND (
token = 'uEYSHCcnoStEfTBPQHOgI3zyUhadDcDofUfVCwyoF1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)