UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oOL5ZGWqL6Ycm3hLEwo/EsdOnt8bfhfKgoxlw14TCGw='
WHERE
key_id = '6f0539ea614bac1cede06403a6d63f59cffe081163c009dd5b7fb1f3177b5d4e'
AND (
token = 'oOL5ZGWqL6Ycm3hLEwo/EsdOnt8bfhfKgoxlw14TCGw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)