UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+J3io/L/iWcW+9XToBXRvu4uo0UEJ02xMVQI3Tkx0BM=' 
WHERE 
  key_id = 'eaec057bdd4f049d3867ae6856153c41bb0ae62a73a5d8bdae5acbc39268760d' 
  AND (
    token = '+J3io/L/iWcW+9XToBXRvu4uo0UEJ02xMVQI3Tkx0BM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039