UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '80/TNZ9vIA2+khY+GtwkOC3bCl60xVcFNsQH0AwEU04=' 
WHERE 
  key_id = '698a8ce7f8817d6db84fd1a250a3177d2199a2c13a85894fb1e2ec9312c20d81' 
  AND (
    token = '80/TNZ9vIA2+khY+GtwkOC3bCl60xVcFNsQH0AwEU04=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035