Icon color based on date

I’m trying to format icon colours (of a mushroom entity card) based on the date of a sensor (mot expiry date), but can’t seem to figure out the coding. I have the sensor.date setup in config.yaml.

icon_color:
  - if:
      condition: "{{ ('sensor.mot') > ('sensor.date')+45 }}"
      then: "green"
  - if:
      condition: "{{ ('sensor.mot') >= ('sensor.date') and < ('sensor.date')+45 }}"
      then: "orange"
  - if:
      condition: "{{ ('sensor.mot') < ('sensor.date') }}"
      then: "red"

What am I missing please?

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16