Update specific structure field

I want to update a specific structure entry. I have tried with that function but it only appends the items to the structure field. Is there a way I can update a specific one?

Example using Starterkit social field:

$structure = $page->social()->yaml();
$item = $structure[0];
$item['platform'] = 'New Value';
$structure[0] = $item;

dump($structure);