The function should be called after detecting login from a proper source.
Functionality:
- a. if there is no record with the given user and policy it means that this is a new one - so It adds a new row
- b. if there is a record with a given user and policy but confirmed is set to 0 it means that policy was updated, so it updated confirmed and date
- c. in any other case do nothing