UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4DNW2Q2Ex666hK64F1gmycdbq8o32O6MG8RHUfbOKos='
WHERE
key_id = 'e7b1cbc1a5f302f0b40dd3f4359305ec2a97e69bf206a81ee3d00f2532a64167'
AND (
token = '4DNW2Q2Ex666hK64F1gmycdbq8o32O6MG8RHUfbOKos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)