The slow log settings are node settings and not index settings, so you can't change these settings via the update index settings api.
You can change these settings via the cluster update api:
PUT /_cluster/settings
{
"transient": {
"index.search.slowlog.threshold.query.warn": "60s",
"index.search.slowlog.threshold.query.info": "50s",
"index.search.slowlog.threshold.query.debug": "40s",
"index.search.slowlog.threshold.query.trace": "20s",
"index.search.slowlog.threshold.fetch.warn": "30s",
"index.search.slowlog.threshold.fetch.info": "50s",
"index.search.slowlog.threshold.fetch.debug": "40s",
"index.search.slowlog.threshold.fetch.trace": "20s",
"index.indexing.slowlog.threshold.index.warn": "60s",
"index.indexing.slowlog.threshold.index.info": "50s",
"index.indexing.slowlog.threshold.index.debug": "40s",
"index.indexing.slowlog.threshold.index.trace": "20s"
}
}
For more info, see the slow log documentation page.