UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KNAkKTvOcdCs3Ke/KxWtMf3AaMNBTOTv9ZaFeyKFGTE=' 
WHERE 
  key_id = '86accc1ca0c81fd00a72e3ef44305147d33e540d3fd0f74369e7fcecac03415e' 
  AND (
    token = 'KNAkKTvOcdCs3Ke/KxWtMf3AaMNBTOTv9ZaFeyKFGTE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052