UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U++OIvpVGdw/PJXUBeCgrdLBLg6NcTn0dTOUM79B4y0=' 
WHERE 
  key_id = '393e2d171ab8e225fb890c86b18baeda5d3f97f691db4246cc1de7bab393a523' 
  AND (
    token = 'U++OIvpVGdw/PJXUBeCgrdLBLg6NcTn0dTOUM79B4y0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024