Delete expired device attribute and messages from database