UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DPtuN6SHAel36K92o092OiAak1Oix2xmEpYixFwJjLg=' 
WHERE 
  key_id = '104d73cb7fe888de7a31b46c1a3ffd46806d97ae3a4e56e69e2f2ee0708e3e17' 
  AND (
    token = 'DPtuN6SHAel36K92o092OiAak1Oix2xmEpYixFwJjLg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052