UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0eremivWFG2wXMc/6emrBYFvgEvl4T3lYa2k+jK0phA='
WHERE
key_id = '1f80f68a766b8262412c1ff00997c453f3746722ed055fdd69cda03e411a2569'
AND (
token = '0eremivWFG2wXMc/6emrBYFvgEvl4T3lYa2k+jK0phA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)