Delete duplicate with same ID PHP/PDO/MYSQL
It seems like just the session id would be 'unique' for defining the User?  And maybe a separate table would hold the multiple bell_mode values for each user?  You have to think through the application to figure out what is "unique"; we cannot do it for you.

CURDATE() is a date, not a datetime.  NOW() is a datetime.

CURDATE() &lt; ring_date -- before midnight this morning


It is clumsy to have two separate columns for a "date" and a "time".  I strongly suggest you combine those two columns into a DATETIME datatype; I'll call it ring_dt.  DATE(ring_dt) and TIME(ring_dt) are the 'date' and 'time' parts of ring_dt.  It's easier to take a DATETIME apart than to put it together.

CURDATE() &lt; ring_dt -- same as above
ring_dt &gt; NOW() - INTERVAL 1 DAY  -- more than 24 hours ago (to the second)
ring_dt &gt; CURDATE() - INTERVAL 1 DAY  -- before yesterday's 12am. (not very useful)


- INTERVAL 1 DAY and - INTERVAL 24 HOUR have the same effect.