UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LQghWhG7v0HyG8W5KmupvCGkrLehrg3CnRTwltkQt6E='
WHERE
key_id = 'eaf39cf9f85c1d4a69fdaad6f6332da0c487e451e6b6e3ae91e89b1d95676e10'
AND (
token = 'LQghWhG7v0HyG8W5KmupvCGkrLehrg3CnRTwltkQt6E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)