UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8kPfKhng47Iu97/Ynzn8Oiv/Z74+wi7rl/AIXSzxlec='
WHERE
key_id = 'e58423058c60b2c55066aee3ca0bf423cdbfe5559e1b11d9e1640082c443afd4'
AND (
token = '8kPfKhng47Iu97/Ynzn8Oiv/Z74+wi7rl/AIXSzxlec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)