UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hshPta9f9JpAiOP3hKRevSiYRr8L4O72fuTZcXL1N34=' 
WHERE 
  key_id = '8abe59ac08d625111128e2ac6588cf295896a048d2671f7bdc1adce5e4579935' 
  AND (
    token = 'hshPta9f9JpAiOP3hKRevSiYRr8L4O72fuTZcXL1N34=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030