UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jZSaOz3SLTsOIRCn/yNz6Q/vHPCjJ0/6l9A+vPr9eCU='
WHERE
key_id = '667ac3a1293edf20c5adc43bc3b98e413ede5793fd46ec404b94c89f204b44ba'
AND (
token = 'jZSaOz3SLTsOIRCn/yNz6Q/vHPCjJ0/6l9A+vPr9eCU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)