UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wzfhb33icY5EF0ciMjePjBrcHnSKbrowvB53phyLCak='
WHERE
key_id = '1aea364bcfeed50fbf03bf33d8cbbeda8181b069606c8bee3f6d6837883d691f'
AND (
token = 'wzfhb33icY5EF0ciMjePjBrcHnSKbrowvB53phyLCak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)