UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FrWqurRqB4Z3unHRGrzjEMo2522IHPyCFZAAZlbyEI0='
WHERE
key_id = '3795902613d2a7fe2d587faede6dcfbc3b18d1819b6dbfdaca70678670819c5b'
AND (
token = 'FrWqurRqB4Z3unHRGrzjEMo2522IHPyCFZAAZlbyEI0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)