UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zevXpqMGzEeI0ZcmjZn4VfWWh85qh3w9r2dysf6tGp0='
WHERE
key_id = '42d0dc31fc1ad253310186706735b3bcedfd9a37e39a2c2420652584c9b586ce'
AND (
token = 'zevXpqMGzEeI0ZcmjZn4VfWWh85qh3w9r2dysf6tGp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)