UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XYKhlGqzdoGr9VSRaAdAn5YCCXAZE6sYYBWYt3s8mEQ='
WHERE
key_id = '83d803cdc6f8f5896fa0ac630b48a2103b0baad8db0dfa0bd8de4e62af275dfb'
AND (
token = 'XYKhlGqzdoGr9VSRaAdAn5YCCXAZE6sYYBWYt3s8mEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)