Hi Poola,
You can simply use the decision action in your microflow. And use an expression along the lines of:
$Appointment/date < [%CurrentDateTime%]
If that descision is true, then change or delete the appointment, otherwise show an error message to the user that they can't cancel it anymore. Also, you might want to check this doc: https://docs.mendix.com/refguide/expressions/