Alert condition for multi queries

I set an alert with multiple queries:
A: kube_pod_container_status_restarts_total{namespace=~“…”} > 5
B: sum(changes(kube_pod_container_status_restarts_total{namespace=~“…”}[10m])) by (pod) > 0
I want to get the alert if a pod Is restarted in the last 10 minutes and if the number of restarts is above 5
Which expression should I use if I don’t want to use the classic condition?