Hi @twistysnacks
$value holds an array of rows. It is this array that you save.
All you need to do is loop through the array and modify the row you want, then save the array like normal.
It is the line
$value[] = array("sub_field_1" => "Foo", "sub_field_2" => "Bar");
That ‘adds’ to the array, by removing this, there will be no rows added