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.

  - 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?