def METHOD_NAME(chat_id, soft_warn):
    with WARN_SETTINGS_LOCK:
        curr_setting = SESSION.query(WarnSettings).get(str(chat_id))
        if not curr_setting:
            curr_setting = WarnSettings(chat_id, soft_warn=soft_warn)
        curr_setting.soft_warn = soft_warn
        SESSION.add(curr_setting)
        SESSION.commit()