UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x1MuedyctF7qNfDS13k8OjMJ9t9F+//ueYtgFWGBAw0=' 
WHERE 
  key_id = '492113dd4b262a6a7f8e03ef41ad606f058d57471d849239f3d4f65a4d3b1eac' 
  AND (
    token = 'x1MuedyctF7qNfDS13k8OjMJ9t9F+//ueYtgFWGBAw0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022