IsCompleted field in CaseMilestone is not Writeable/Editable.
So, this cannot be updated.
But, to update the IsCompleted field, update the CompletionDate field. Once the CompletionDate field is updated, the IsCompleted flag will be updated.
Sample code:
update new CaseMilestone( Id = ‘IdOfCaseMilestone‘, CompletionDate = System.now() );