Not triggering SEOMatic on save element
By setting the regenerateSitemapsAutomatically to false, SEOMatic won't regenerate a sitemap for every entry saved.
At the end of the job, I set it back to true and save the first element inside of the same section.

Changes to the original code: 

Seomatic::$settings-&gt;regenerateSitemapsAutomatically=false; // Disable it

while (($csv = fgetcsv($handle)) !== false) {
    $entry = Entry::find()-&gt;siteId($siteId)-&gt;section('products')-&gt;where(['content.field_productId' =&gt; $csv[0]])-&gt;one();

    if (!$entry) {
        $entry = new Entry();
        $entry-&gt;sectionId = Craft::$app-&gt;sections-&gt;getSectionByHandle('products')-&gt;id;
        $entry-&gt;typeId = 1;
        $entry-&gt;siteId = $siteId;
    }


    ...
    ...
    ...


    try {
        Craft::$app-&gt;elements-&gt;saveElement($entry);
    } catch (Throwable $e) {
        throw new RuntimeException($e);
    }
}

try {
    Seomatic::$settings-&gt;regenerateSitemapsAutomatically=true; // Enable it again
    $firstElement = Entry::find()-&gt;siteId($siteId)-&gt;section('products')-&gt;one();
    Craft::$app-&gt;elements-&gt;saveElement($firstEntry); // Save first entry again
} catch (Throwable $e) {
    throw new RuntimeException($e);
}


Thanks to Oli for the suggestion.