UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YRupU97cjEz+Xr15GHOCZo3hmGD+yBl/xi+ksshtgOo=' 
WHERE 
  key_id = '01cf64558fbfb082d88f2555797d4aed19b8e6f04ca6e1c4ff5e4810186ee336' 
  AND (
    token = 'YRupU97cjEz+Xr15GHOCZo3hmGD+yBl/xi+ksshtgOo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049