UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QkQ/9tvxNbSVtOPI1aafXhEiR5wluZjBQZSQ1t+lZQc='
WHERE
key_id = '4688c97aaed5f66e0d131ae5e0eeff2f8c3f12d6e9d687e441ac0c0752746ef5'
AND (
token = 'QkQ/9tvxNbSVtOPI1aafXhEiR5wluZjBQZSQ1t+lZQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)