UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S2p5+2RTKhZ5M4dfNRA2HFkRz3ipnmJZS1jzbiRM+XU='
WHERE
key_id = '3ebf9fd93e2a8e7e50e77b3cf6f9f113a7ebfad4fc9d3fcc39586a52fd915c91'
AND (
token = 'S2p5+2RTKhZ5M4dfNRA2HFkRz3ipnmJZS1jzbiRM+XU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)