def METHOD_NAME(gstin, transaction_date):
    settings = frappe.get_cached_doc("GST Settings")
    if (
        not settings.validate_gstin_status
        or not is_api_enabled(settings)
        or settings.sandbox_mode
        or not transaction_date  # not from transactions
        or frappe.cache.get_value(gstin)
    ):
        return
    doc = frappe.db.get_value(
        "GSTIN", gstin, ["last_updated_on", "status"], as_dict=True
    )
    if not doc or doc.status not in ("Active", "Cancelled"):
        return True
    days_since_last_update = date_diff(get_datetime(), doc.get("last_updated_on"))
    return days_since_last_update >= settings.gstin_status_refresh_interval