UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XXI7XXzyzoqbQN+Zgc2LnxL+hODBucDxIn+4sZLJcg4='
WHERE
key_id = '383a1d03f102dc2f9464eae49946a3aad8b800ab9001725fb1e08d0c66c07f9c'
AND (
token = 'XXI7XXzyzoqbQN+Zgc2LnxL+hODBucDxIn+4sZLJcg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)