use `nowdate` instead of `date.today()`

Co-Authored-By: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py
index 9903884..b97eefc 100644
--- a/erpnext/selling/doctype/quotation/quotation.py
+++ b/erpnext/selling/doctype/quotation/quotation.py
@@ -189,7 +189,8 @@
 	from datetime import date
 	DATE_FORMAT = "%Y%m%d" # For converting python date to SQL comparable date
 	today = date.today().strftime(DATE_FORMAT)
-	frappe.db.sql("UPDATE tabQuotation SET status = 'Expired' WHERE valid_till < " + today)
+	frappe.db.sql("""UPDATE `tabQuotation` SET status = 'Expired' 
+		WHERE status != 'Expired' AND 'valid_till < %s""" , (nowdate()))
 
 @frappe.whitelist()
 def make_sales_invoice(source_name, target_doc=None):