Duplicate entries in visit table


I am using piwik log analytics. I process my logs using import_logs.py file which works fine.
In database there are duplicate rows being created with all columns same and new idvisit value.
As per my understanding combination of idvisitor and visit_first_action_time should give unique idvisit but that is not what i see in the database.
If I count the entries with group by idvisitor and visit_first_action_time there are multiple entries for few rows and many are with count 1.

Can you please help me with understanding the behavior.
I am using 2.4.1 version of piwik as that was the latest when I started to work on it and i have all my other systems to work fine with the same so will be difficult to upgrade if this problem was already fixed.
Please suggest a solution.