You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and plan_id in(274) and valid_to >= '2025-08-03'' at line 1