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