UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xP6KkzllM2vpSDAb6FOWOCQur+EYzLuNXWlBin5m/aM='
WHERE
key_id = '4389d6b03406fe67fb8b0c287e2dbf8f659766ec6f62fe0009d7509f48cc323d'
AND (
token = 'xP6KkzllM2vpSDAb6FOWOCQur+EYzLuNXWlBin5m/aM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)