UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zow26iwaBZ2dIaML0CuLLz3Wal1rpqIgjyfs9hGAsBI='
WHERE
key_id = '7f1bac26bd7ab31b3a45f7531b6afd461a01572ac95fb80fd84be99ef27fdbc4'
AND (
token = 'Zow26iwaBZ2dIaML0CuLLz3Wal1rpqIgjyfs9hGAsBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)