import frappe

def execute():
	frappe.db.set_value("System Settings", "System Settings", "document_share_key_expiry", 30)
	frappe.db.set_value("System Settings", "System Settings", "allow_older_web_view_links", 1)

import frappe

def execute():
	frappe.db.set_value("System Settings", "System Settings", {
		"document_share_key_expiry": 30,
		"allow_older_web_view_links": 1
	})

Set values in a single query
refactor: Set values in a single query
