def update_only_existing_keys(dict1, dict2):
    """
    Like `dict1.update(dict2)`, only for keys already in dict1
    """

    partial_dict2 = {k: v for (k, v) in dict2.items() if k in dict1}
    dict1.update(partial_dict2)
    return dict1