Mysql innodb table dead lock while batch update in multiple threads

I have two tables of type innoDB and I am updating a table using a batch statement of 10 threads (one instruction per batch per string), but at some point I am getting a total block.

java.sql.BatchUpdateException: a deadlock was encountered while trying to block; try to restart the transaction
in com.mysql.jdbc.StatementImpl.executeBatch (StatementImpl.java:1046)
in com.jolbox.bonecp.StatementHandle.executeBatch (StatementHandle.java:469)

Scheme of table 1 –

CREATE THE TABLE `FantasyMatchUserPlayersV2` (
`id` bigint (20) NOT NULL AUTO_INCREMENT,
`contestType` int (11) DEFAULT NULL,
`lastUpdatedTime` bigint (20) NOT NULL,
`matchId` int (11) NOT NULL,
`matchIdPlayerIdContestType` varchar (255) DEFAULT NULL,
`matchIdPlayerIdContestTypeUserBucket` varchar (255) DEFAULT NULL,
`playerId` int (11) DEFAULT NULL,
`score` int (11) NOT NULL,
`userBucket` int (11) NOT NULL,
`userId` bigint (20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `matchId_playerId_contestType_userBucket` (` matchIdPlayerIdContestTypeUserBucket`),
KEY `matchId_playerId_contestType` (` matchIdPlayerIdContestType`),
KEY `userId` (` userId`),
KEY `matchId` (` matchId`),
KEY `playerId` (` playerId`)
) MOTOR = InnoDB

Scheme of table 2 –

CREATE TABLE `FantasyMatchContestsV2` (
`id` bigint (20) NOT NULL AUTO_INCREMENT,
`captainId` int (11) DEFAULT NULL,
`completed` tinyint (1) DEFAULT NULL,
`contestType` int (11) DEFAULT NULL,
`createdTime` datetime DEFAULT NULL,
`lastUpdatedTime` bigint (20) NOT NULL,
`matchId` int (11) NOT NULL,
`matchIdContestTypeUserBucket` varchar (255) DEFAULT NULL,
`points` int (11) NOT NULL,
`userBucket` int (11) NOT NULL,
`userId` bigint (20) DEFAULT NULL,
`viceCaptainId` int (11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `userId` (` userId`, `matchIdContestTypeUserBucket`),
KEY `matchIdContestTypeUserBucket` (` matchIdContestTypeUserBucket`),
KEY `captainId` (` captainId`),
KEY `viceCaptainId` (` viceCaptainId`),
KEY `contestType` (` contestType`),
KEY `matchId` (` matchId`)
) MOTOR = InnoDB

Batch statements that are executed through 10 subprocesses, each subprocess will execute different types of contest (from 1 to 10)

update FantasyMatchContestsV2 c inside join FantasyMatchUserPlayersV2 p in c.matchId = p.matchId AND c.userId = p.userId AND c.contestType = p.contestType AND c.userBucket = p.userBucket set c.points = (c.pointsType + c ), c.lastUpdatedTime = 1555161797491 where p.playerId = 127 AND p.matchId = 40288 AND p.contestType = 0 and p.userBucket = 0,
update FantasyMatchContestsV2 c setpoints = (points + 248), lastUpdatedTime = 1555161797491 where c.captainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 0,
update FantasyMatchContestsV2 c setpoints = (points + 124), lastUpdatedTime = 1555161797491 where c.viceCaptainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 0,
update FantasyMatchContestsV2 c inside join FantasyMatchUserPlayersV2 p in c.matchId = p.matchId AND c.userId = p.userId AND c.contestType = p.contestType AND c.userBucket = p.userBucket set c.points = (c.pointsType + c ), c.lastUpdatedTime = 1555161797491 where p.playerId = 127 AND p.matchId = 40288 AND p.contestType = 0 and p.userBucket = 1,
update FantasyMatchContestsV2 c setpoints = (points + 248), lastUpdatedTime = 1555161797491 where c.captainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 1,
update FantasyMatchContestsV2 c setpoints = (points + 124), lastUpdatedTime = 1555161797491 where c.viceCaptainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 1,
update FantasyMatchContestsV2 c inside join FantasyMatchUserPlayersV2 p in c.matchId = p.matchId AND c.userId = p.userId AND c.contestType = p.contestType AND c.userBucket = p.userBucket set c.points = (c.pointsType + c ), c.lastUpdatedTime = 1555161797491 where p.playerId = 127 AND p.matchId = 40288 AND p.contestType = 0 and p.userBucket = 2,
update FantasyMatchContestsV2 setpoints c = (points + 248), lastUpdatedTime = 1555161797491 where c.captainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 2,
update FantasyMatchContestsV2 activation points c = (points + 124), lastUpdatedTime = 1555161797491 where c.viceCaptainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 2,
update FantasyMatchContestsV2 c inside join FantasyMatchUserPlayersV2 p in c.matchId = p.matchId AND c.userId = p.userId AND c.contestType = p.contestType AND c.userBucket = p.userBucket set c.points = (c.pointsType + c ), c.lastUpdatedTime = 1555161797491 where p.playerId = 127 AND p.matchId = 40288 AND p.contestType = 0 and p.userBucket = 3,
update FantasyMatchContestsV2 c setpoints = (points + 248), lastUpdatedTime = 1555161797491 where c.captainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 3,
update FantasyMatchContestsV2 c setpoints = (points + 124), lastUpdatedTime = 1555161797491 where c.viceCaptainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 3,
update FantasyMatchContestsV2 c inside join FantasyMatchUserPlayersV2 p in c.matchId = p.matchId AND c.userId = p.userId AND c.contestType = p.contestType AND c.userBucket = p.userBucket set c.points = (c.pointsType + c ), c.lastUpdatedTime = 1555161797491 where p.playerId = 127 AND p.matchId = 40288 AND p.contestType = 0 and p.userBucket = 4,
update FantasyMatchContestsV2 c setpoints = (points + 248), lastUpdatedTime = 1555161797491 where c.captainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 4,
update FantasyMatchContestsV2 activation points c = (points + 124), lastUpdatedTime = 1555161797491 where c.viceCaptainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 4,
update FantasyMatchContestsV2 c inside join FantasyMatchUserPlayersV2 p in c.matchId = p.matchId AND c.userId = p.userId AND c.contestType = p.contestType AND c.userBucket = p.userBucket set c.points = (c.pointsType + c ), c.lastUpdatedTime = 1555161797491 where p.playerId = 127 AND p.matchId = 40288 AND p.contestType = 0 and p.userBucket = 5,
update FantasyMatchContestsV2 c setpoints = (points + 248), lastUpdatedTime = 1555161797491 where c.captainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 5,
update FantasyMatchContestsV2 c setpoints = (points + 124), lastUpdatedTime = 1555161797491 where c.viceCaptainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 5,
update FantasyMatchContestsV2 c inside join FantasyMatchUserPlayersV2 p in c.matchId = p.matchId AND c.userId = p.userId AND c.contestType = p.contestType AND c.userBucket = p.userBucket set c.points = (c.pointsType + c ), c.lastUpdatedTime = 1555161797491 where p.playerId = 127 AND p.matchId = 40288 AND p.contestType = 0 and p.userBucket = 6,
update FantasyMatchContestsV2 activation points c = (points + 248), lastUpdatedTime = 1555161797491 where c.captainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 6,
update FantasyMatchContestsV2 setpoints c = (points + 124), lastUpdatedTime = 1555161797491 where c.viceCaptainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 6,
update FantasyMatchContestsV2 c inside join FantasyMatchUserPlayersV2 p in c.matchId = p.matchId AND c.userId = p.userId AND c.contestType = p.contestType AND c.userBucket = p.userBucket set c.points = (c.pointsType + c ), c.lastUpdatedTime = 1555161797491 where p.playerId = 127 AND p.matchId = 40288 AND p.contestType = 0 and p.userBucket = 7,
update FantasyMatchContestsV2 c setpoints = (points + 248), lastUpdatedTime = 1555161797491 where c.captainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 7,
update FantasyMatchContestsV2 activation points c = (points + 124), lastUpdatedTime = 1555161797491 where c.viceCaptainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 7,
update FantasyMatchContestsV2 c inside join FantasyMatchUserPlayersV2 p in c.matchId = p.matchId AND c.userId = p.userId AND c.contestType = p.contestType AND c.userBucket = p.userBucket set c.points = (c.pointsType + c ), c.lastUpdatedTime = 1555161797491 where p.playerId = 127 AND p.matchId = 40288 AND p.contestType = 0 and p.userBucket = 8,
update FantasyMatchContestsV2 c setpoints = (points + 248), lastUpdatedTime = 1555161797491 where c.captainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 8,
update FantasyMatchContestsV2 activation points c = (points + 124), lastUpdatedTime = 1555161797491 where c.viceCaptainId = 127 and c.matchId = 40288 and c.contestType = 0 and c.userBucket = 8