<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def mediatype_update(mediatypeid, name=False, mediatype=False, **kwargs):
    '''
    Update existing mediatype

    .. note::
        This function accepts all standard mediatype properties: keyword
        argument names differ depending on your zabbix version, see here__.

        .. __: https://www.zabbix.com/documentation/3.0/manual/api/reference/mediatype/object

    :param mediatypeid: ID of the mediatype to update
    :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
    :param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring)
    :param _connection_url: Optional - url of zabbix frontend (can also be set in opts, pillar, see module's docstring)

    :return: IDs of the updated mediatypes, False on failure.

    CLI Example:
    .. code-block:: bash

        salt '*' zabbix.usergroup_update 8 name="Email update"
    '''
    conn_args = _login(**kwargs)
    ret = {}
    try:
        if conn_args:
            method = 'mediatype.update'
            params = {"mediatypeid": mediatypeid}
            if name:
                params['description'] = name
            if mediatype:
                params['type'] = mediatype
            params = _params_extend(params, **kwargs)
            ret = _query(method, params, conn_args['url'], conn_args['auth'])
            return ret['result']['mediatypeids']
        else:
            raise KeyError
    except KeyError:
        return ret