UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p8gbXpMAvvjJRY4csphxUqszvaKWiua5Zr/JP/zP+VE='
WHERE
key_id = '2d7194066990872359ac9c0cc121f94f69b6262cf84949393d1c14bcbcf2c2fc'
AND (
token = 'p8gbXpMAvvjJRY4csphxUqszvaKWiua5Zr/JP/zP+VE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)