UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ysfBXyfEZXGSugOrUA+HgzBYLVA1WD/K/yDibra3mns=' 
WHERE 
  key_id = '552528d0180b79c9c5d60b77ea65de19245c84f7990802d7dc110d3d9ef39a9f' 
  AND (
    token = 'ysfBXyfEZXGSugOrUA+HgzBYLVA1WD/K/yDibra3mns=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020