UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+5TOnYcCaU+K2PQpM9TF6arrtwJWXQWdJRF33d6430M='
WHERE
key_id = '535dd092a589ff3c8be00485c2719f69de6219453a3415a3df080b310ad43c76'
AND (
token = '+5TOnYcCaU+K2PQpM9TF6arrtwJWXQWdJRF33d6430M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)