This should also work for Drupal 8 and Drupal 10 versions.
Here we will give an option to query paragraphs, which is one of the most used contrib entities used in the Drupal, very useful and key-item for some projects.
Fortunately, to query paragraphs is similar to query any other entity in Drupal 9, we must use the entityQuery, as below:
// Get all the paragraph ids which have a specific field_name value.
$paragraph_ids = \Drupal::entityQuery('paragraph')
->condition('type', 'paragraph_type')
->condition('field_name', $name)
->execute();
To load the paragraphs you can use the own loadMultiple method from Paragraph entity to load multiple items, as below:
// Load multiple paragraph entities.
$paragraphs = Paragraph::loadMultiple($paragraph_ids);
// Foreach to set value and save each one.
foreach ($paragraphs as $paragraph) {
$paragraph->set('field_active', TRUE);
$paragraph->save();
}