N1ql query for conditional OBJECT_PUT within an array

Hello,
Could you please help me to construct an update for an attribute of an object withing an array only for those objects that have a specific value in a specific attribute?
My document:

{
“work”: “work_1”,
“territory”: [
{
“country”: {
“value”: “UK”,
“id”: “1111”
},
“status”: “Pending”,
“selected”: false
},
{
“country”: {
“value”: “FR”,
“id”: “1112”
},
“status”: “Confirmed”,
“selected”: false
}
]
}

So I need to update all documents (with above structure) where country code is UK, I need to change everywhere UK to GB .
Below n1ql I tyried to create is changing everywhere value of country object to GB and deletes somehow “selected” and “status” attributes.

UPDATE dept SET
territory=(ARRAY OBJECT_PUT(t.country, “value”, “GB”
) FOR t IN territory END
)

Can someone please help me to correct it? Thanks in advance.

UPDATE default AS d
SET t.country.`value` = "GB" FOR t IN d.territory WHEN t.country.`value` = "UK" END
WHERE ANY c IN d.territory  SATISFIES c.country.`value` = "UK" END;

Update inside ARRAYs use update-for diagram

UPDATE

update:

set-clause:

update-for:

unset-clause:

Thanks, It worked.
I tried smth similar in the beginning but I forgot to put quotes for value and iy gave me strange error.